/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package simulation;

/**
 *
 * @author haoliang.donghl
 */
public class LoadReader {
    private static LoadReader instance = null;

    public static LoadReader getInstance(){
        if (instance == null){
            instance = new LoadReader();
        }
        return instance;
    }

    private LoadReader(){

    }

    public void loadAll(){
        for (Application app : Application.allApps){
            app.readLoadsFromFile("loads\\" + app.getName() + ".txt");
        }
    }
    
    public void updateAll(float t){
        System.out.println(t);
        for (Application app : Application.allApps){
            app.updateLoad(t);
        }
    }

}
